<extend name="./_base"/>
<block name="css">

</block>
<block name="header">

</block>
<block name="menu">

</block>
<block name="content">
    <article class="page-container">
        <form class="form form-horizontal" id="form-rule">
            <div class="row cl">
                <!--<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>ID：</label>-->
                <div class="formControls col-xs-6">
                    <input type="hidden" class="input-text" value="{$UserData.id}" placeholder="" id="id" name="id">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><span class="c-red">*</span>游戏ID：</label>
                <div class="formControls col-xs-6">
                    <input type="text" class="input-text validate[required]" value="{$UserData.game_user}" placeholder="" id="game_user" name="game_user">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><span class="c-red">*</span>游戏：</label>
                <div class="formControls col-xs-6">
                    <select name="gid" class="input-text">
                        <volist name="GameData" id="vo">
                            <option value="{$vo.id}"
                            <eq name="vo.id" value="$UserData['gid']">selected</eq>
                            >{$vo.name}</option>
                        </volist>
                    </select>
                </div>
            </div>
            <div class="row cl">
                <div class="col-xs-6 col-xs-offset-3">
                    <input class="btn btn-primary btn-block radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                </div>
            </div>
        </form>
    </article>

</block>

<block name="script">

    <script type="text/javascript">
        $(function(){

            $('#form-admin-add').validationEngine();

            $('.skin-minimal input').iCheck({
                checkboxClass: 'icheckbox-blue',
                radioClass: 'iradio-blue',
                increaseArea: '20%'
            });

            var flag=true;

            $('#form-rule').submit(function () {
                if ($(this).validationEngine('validate')){
                    if (!flag){
                        return false;
                    }
                    flag=false;
                    $.post("",$(this).serialize(),function (result) {
                        if(result.status==1){
                            layer.alert(result.info,{icon:6},function () {
                                parent.location.reload();
                            })
                        }else {
                            layer.alert(result.info,{icon:5})
                        }
                        flag=true;
                    },"json");
                }
                return false;
            });
        });
    </script>

</block>
